Fix for user-defined inlet velocity profile failure#556
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #556 +/- ##
=======================================
Coverage 69.02% 69.02%
=======================================
Files 181 181
Lines 34133 34134 +1
Branches 5905 5904 -1
=======================================
+ Hits 23560 23561 +1
Misses 10436 10436
Partials 137 137 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Looks good to me! |
There was a problem hiding this comment.
Pull request overview
Fixes a solver initialization issue that breaks user-defined inlet velocity profiles (Issue #555) by avoiding an unconditional reallocation of bcType::gx during boundary-condition initialization.
Changes:
- Preserve previously-read user-defined spatial profile data in
lBc.gxby only allocating when it is empty. - Prevents user-defined profile values from being reset to zero during
bc_ini().
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| // lBc.gx may have values set when for example when | ||
| // reading in a user-defined profile. | ||
| if (lBc.gx.size() == 0) { | ||
| lBc.gx.resize(lFa.nNo); | ||
| } |
There was a problem hiding this comment.
@ktbolt is it worth validating that lBc.gx.size() == lFa.nNo if it's not 0?
| lBc.gx.resize(lFa.nNo); | ||
| //if (.NOT.ALLOCATED(lBc.gx)) ALLOCATE(lBc.gx(lFa.nNo)) | ||
|
|
||
| // lBc.gx may have values set when for example when |
There was a problem hiding this comment.
@ktbolt do you have a test you can add for user-defined spatial profile?
|
|
||
| // lBc.gx may have values set when for example when | ||
| // reading in a user-defined profile. | ||
| if (lBc.gx.size() == 0) { |
There was a problem hiding this comment.
Interesting, so previously any time a user defined a spatial profile the solver would fail?
There was a problem hiding this comment.
@aabrown100-git Correct; there are no CI tests for the Spatial_profile_file_path parameter.
| // lBc.gx may have values set when for example when | ||
| // reading in a user-defined profile. | ||
| if (lBc.gx.size() == 0) { | ||
| lBc.gx.resize(lFa.nNo); | ||
| } |
There was a problem hiding this comment.
@ktbolt is it worth validating that lBc.gx.size() == lFa.nNo if it's not 0?
| lBc.gx.resize(lFa.nNo); | ||
| //if (.NOT.ALLOCATED(lBc.gx)) ALLOCATE(lBc.gx(lFa.nNo)) | ||
|
|
||
| // lBc.gx may have values set when for example when |
There was a problem hiding this comment.
@ktbolt do you have a test you can add for user-defined spatial profile?
|
@aabrown100-git It might be good to check that |
This is a simple fix for #555.
There is no CI test for a user-defined inlet velocity profile.